<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="f" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%--
  Created by IntelliJ IDEA.
  User: 16704
  Date: 2019/6/26
  Time: 上午 09:12
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>房间设施-宿管系统</title>
    <link rel="stylesheet" href="../../css/basicLayout.css">
</head>
<body>

<!--    头部，用来放导航栏-->
<div id="header">
    <ul>
        <li><a href="${pageContext.request.contextPath}/student/index"> 学生管理</a></li>
        <li><a href="${pageContext.request.contextPath}/class/index"> 班级管理</a></li>
        <li><a href="${pageContext.request.contextPath}/room/index"> 房间管理</a></li>
    </ul>
</div>

<!--子导航栏区域-->
<div id="child">
    <label>学生管理功能</label>
    <ul>

        <li><a href="${pageContext.request.contextPath}/room/add/index">添加房间</a></li>
    </ul>
</div>

<!--主体内容区域-->
<div id="content">
    <div id="search">
        <form action="${pageContext.request.contextPath}/room/record/add/execute?roomId=${roomId}" id="searchForm" method="post">
            <table id="searchTable">
                <tr>
                    <td>损坏日期：<input type="date" id="date" name="date" value=""></td>
                    <td>损坏描述：<textarea rows="1" cols="50" name="msg">

                    </textarea></td>

                    <td><input type="submit" value="添加"></td>
                    <td><input type="reset" value="重置"></td>
                </tr>
            </table>
        </form>
    </div>
    <div id="show">
        <table id="showTable">
            <tr>

                <th>损坏描述</th>
                <th>损坏日期</th>
                <th>是否解决</th>

            </tr>

            <c:forEach items="${records}" var="record">
                <tr>
                    <td>${record.description}</td>
                    <td><f:formatDate value="${record.recordDate}" pattern="yyyy-MM-dd"/> </td>
                    <td>
                        <c:if test="${record.recordStatus==0}">
                            <a href="${pageContext.request.contextPath}/room/record/execute?recordId=${record.recordId}&roomId=${roomId}">点击解决</a>
                        </c:if>

                        <c:if test="${record.recordStatus==1}">
                            已解决
                        </c:if>
                    </td>
                </tr>
            </c:forEach>
        </table>
    </div>
</div>

<!--页脚内容区域-->
<div id="footer">页脚</div>
</body>
</html>
